<%@ page import="com.confidena.Message" %>



<div class="fieldcontain ${hasErrors(bean: messageInstance, field: 'creationDate', 'error')} required">
	<label for="creationDate">
		<g:message code="message.creationDate.label" default="Creation Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="creationDate" precision="day"  value="${messageInstance?.creationDate}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: messageInstance, field: 'messagesSon', 'error')} ">
	<label for="messagesSon">
		<g:message code="message.messagesSon.label" default="Messages Son" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${messageInstance?.messagesSon?}" var="m">
    <li><g:link controller="messageSon" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="messageSon" action="create" params="['message.id': messageInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'messageSon.label', default: 'MessageSon')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: messageInstance, field: 'personFrom', 'error')} required">
	<label for="personFrom">
		<g:message code="message.personFrom.label" default="Person From" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="personFrom" name="personFrom.id" from="${com.confidena.security.Person.list()}" optionKey="id" required="" value="${messageInstance?.personFrom?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: messageInstance, field: 'personTo', 'error')} required">
	<label for="personTo">
		<g:message code="message.personTo.label" default="Person To" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="personTo" name="personTo.id" from="${com.confidena.security.Person.list()}" optionKey="id" required="" value="${messageInstance?.personTo?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: messageInstance, field: 'subject', 'error')} ">
	<label for="subject">
		<g:message code="message.subject.label" default="Subject" />
		
	</label>
	<g:textField name="subject" value="${messageInstance?.subject}"/>
</div>

